# -*- coding: utf-8 -*-

import xlrd
import time, datetime
from draw.show import draw_zx
#只能读不能写
book=xlrd.open_workbook('/Users/zhaozeyang/Desktop/proxy1.xlsx')#打开一个excel
sheet=book.sheet_by_index(0)#根据顺序获取sheet
print(sheet.cell(0,0).value)#指定行和列获取数据

print(sheet.ncols)#获取excel里面有多少列
print(sheet.nrows)#获取excel里面有多少行

_xz=[]
_yz=[]

for j in range(sheet.nrows):
    for i in range(sheet.ncols):
        print(sheet.cell(j,i).value,end=" ")
    print("\n")

for k in range(sheet.nrows):
    time=sheet.cell(k,0).value
    if(time< 1544378100 or time > 1544378700):
        continue
    dateArray = datetime.datetime.utcfromtimestamp(sheet.cell(k,0).value+28800)
    otherStyleTime = dateArray.strftime("%Y-%m-%d %H:%M:%S")
    _xz.append(otherStyleTime)
    _yz.append(sheet.cell(k,5).value)

draw_zx(_xz,_yz)

